/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file    usart.h
  * @brief   This file contains all the function prototypes for
  *          the usart.c file
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2023 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __USART_H__
#define __USART_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "main.h"

/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

extern UART_HandleTypeDef huart1;

extern UART_HandleTypeDef huart2;

/* USER CODE BEGIN Private defines */
#define DATA_PACKAGE_MIN_LEN  6
//extern uint8_t  USART_RX_BUF[USART_REC_LEN]; 	//
extern uint8_t RxBuffer1[100],RxBuffer2[100]; //

extern uint8_t Uart1_Rx_Cnt  ,Uart2_Rx_Cnt  ;		//
extern __IO uint8_t  Rx_Finish1;
extern __IO uint8_t Rx_Finish2;
extern uint16_t recv_set;
extern		float y1_init;
extern	int16_t y2 ;//һ�׶ε�λ���϶�
extern	int16_t y3 ;//���׶ε�λ���϶�
extern	int16_t y4;//���׶ε�λ���϶ȣ���ҪY����㷴��
extern	int16_t y5 ;//���׶ε�λ���϶�
extern	int16_t y6 ;//���׶ε�λ���϶�
extern	int16_t x1;//һ�׶Σ���λ�룩
extern	int16_t x2;//һ�׶Σ���λ�룩
extern	int16_t x3;//���׶Σ���λ�룩
extern	int16_t x4;//���׶Σ���λ�룩��Ļ����320����Ҫ�����ȵĻ��㣬�ܼ���Ԥ������480s 25pix����ʼ��1.66�μ�һ��һ��1.5����400s/1.66s=240pix
extern	int16_t x5;
extern	int16_t x6;
extern uint16_t PWR_V_UART,PWR_A_UART;
extern uint16_t keyMODE;
#define RX_LEN 20
typedef struct
{
uint8_t  RX_flag;        //IDLE receive flag
uint16_t RX_Size;          //receive length
uint8_t  RX_pData[RX_LEN]; //DMA receive buffer
}USART_RECEIVETYPE;
extern  USART_RECEIVETYPE UsartType;
/* USER CODE END Private defines */

void MX_USART1_UART_Init(void);
void MX_USART2_UART_Init(void);

/* USER CODE BEGIN Prototypes */
 void UsartReceive_IDLE(UART_HandleTypeDef *huart);
/* USER CODE END Prototypes */

#ifdef __cplusplus
}
#endif

#endif /* __USART_H__ */

